package dem1;

import java.util.Comparator;
import java.util.TreeMap;

/**
 * Created with Intellij IDEA.
 * Description:
 * User: 33013
 * Date: 2023-04-02
 * Time: 8:19
 */
public class Test {
    public static void main(String[] args) {
        MyArrayList<String> list = new MyArrayList<>();
        list.add("afecdv");
        //System.out.println(list.get(0));
        //String[] strings = list.getObject();
        try {
            throw new RuntimeException();
        }catch(RuntimeException runtimeException){
            System.out.println("我错了");
        }
        System.out.println("fdfdvxv");
    }

    public static void main2(String[] args) {
        TreeMap<Student,Integer> treeMap = new TreeMap<>();
        Student student1 = new Student("qiyana",16);
        Student student2 = new Student("deilisha",12);
        Student student3 = new Student("yayi",16);
        treeMap.put(student1,1);
        treeMap.put(student2,2);
        treeMap.put(student3,3);
        System.out.println(treeMap);
    }

    public static void main1(String[] args) {
        TreeMap<Integer,String> treeMap1 = new TreeMap<>();
        treeMap1.put(5,"六个核弹");
        treeMap1.put(1,"雷碧");
        treeMap1.put(3,"崩坏3");
        treeMap1.put(4,"原神");
        treeMap1.put(2,"绝区零");
        System.out.println(treeMap1);
        TreeMap<Integer,String> treeMap2 = new TreeMap<>((o1,o2) -> o2 - o1);
        treeMap2.put(5,"六个核弹");
        treeMap2.put(1,"雷碧");
        treeMap2.put(3,"崩坏3");
        treeMap2.put(4,"原神");
        treeMap2.put(2,"绝区零");
        System.out.println(treeMap2);
    }
}
